<!DOCTYPE html>
<html>
    <head>
        <title><?php echo $store_name;?></title>
        <meta charset="UTF-8">
        <meta name="description" content="<?php echo $action['action_name'];?>">
        <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1">
        <link href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
        <script type='text/javascript' src='/public/js/jquery-3.1.1.min.js'></script>
        <script type="text/javascript" src='/public/js/jquery.validate.js'></script>
        <script type="text/javascript" src='/public/js/main/main.js'></script>
        <script>
            var _hmt = _hmt || [];
            (function () {
                var hm = document.createElement("script");
                hm.src = "//hm.baidu.com/hm.js?8d43b5b5d798921b66d689f7a792e6e2";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();
        </script>
        <script type="text/javascript">
            document.domain = '<?php echo _DOMAIN_ALL_;?>';
        </script>
        <link rel="shortcut icon" type="image/ico" href="/favicon.ico">
    </head>
    <body  >



<link href="/public/css/main.css" rel="stylesheet">
<div class="container"  >
    <div class='_main_'>
        <div style='text-align:center;font-size:2rem;margin-top:1.5rem;' > <b>产品评价</b> </div>    
        <div class='_cut2' ></div>
                <div class='thumbnail' style="float:left;">
                    <div style="height:9rem;width:9rem;overflow: hidden;">
                        <img class='_img' src="<?php  echo 'http://'.IMAGE_DOMAIN_.$item['images'][0]['image'] ;?>" style='width:100%;height:100%'/>
                    </div>
                </div>
                <div style='margin-left:12rem;font-size:1.5rem' >
                    <div  style='margin-top:1rem;' ><?php echo $item['name'];?></div>
                    <div style='color:red;margin-top:1rem;' ><i><font >￥<?php echo  $item['price']/100; ?></font></i>
                    </div>
                    <div style='color:red;margin-top:1rem;' ><font >商品评分：<?php echo  substr($score,0,3); ?> 分</font>
                    </div>
                    <input type='hidden' id='store_id' value="<?php echo $item['store_id']; ?>" >
                    <input type='hidden' id='item_number' value="<?php echo $item['item_number']; ?>" >
                </div>
                <div style='clear:both;'></div>
                <?php  foreach($evaluates as $k=>$v){ ?>
                <div id='content' >
                    <div>
                        <img  style='border-radius:50%;width:11%;' src="/public/images/evaluate_tou.jpg" > <?php echo preg_replace('/(1[358]{1}[0-9])[0-9]{4}([0-9]{4})/i','$1****$2',$v['user']['mobile']); ?>
                    </div>
                    <div style='padding:1rem 0 0 5%;' >
                        用户评价：<?php  if( $v['relpy'] != '' ){ echo $v['relpy']; }else{ echo $v['content']; }  ?>
                    </div>
                    <?php if($v['evaluate_id']!=0){ ?>
                    <div style='padding:1rem 0 0 8%;'>
                        <span style='color:#FF8C00;' >商家回复</span>：<?php echo $v['content']; ?>
                    </div>
                    <?php } ?>
                    <div class='_line'></div>
                </div> 
                <div class='_line'></div>
                <?php } ?>


<script type="text/javascript">
$(document).ready(function(){
    //追加
    var number = 12;
    function loaddata(){
        if (number == -1) {
            return;
        }
        totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());

        if ($(document).height() <= totalheight)
        {
            var item_number = $("#item_number").val();
            var store_id = $("#store_id").val();
            $.ajax({url: "/user/evaluate/more_evaluate?start="+number+"&item_number="+item_number+ "&store_id="+store_id, async: true, 
                success: function (msg) {
                    if (msg == 'false') {
                        number = -1;
                        return;
                    }
                    var html = "";
                    msg = eval('(' + msg + ')');
                    $.each(msg, function (i, v) {
                        html += "<div>";
                        html += "<img  style='border-radius:50%;width:11%;' src='/public/images/evaluate_tou.jpg'>";
                        html += v.user.mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
                        html += "</div>";
                        html += "<div style='padding:1rem 0 0 5%;'>用户评价：";
                        html += v.content;
                        html += "</div>";
                        if(v.relpy){
                           html += "<div style='padding:1rem 0 0 8%;'><span style='color:#FF8C00;' >商家回复</span>：";
                           html += v.relpy;
                           html += "</div>";
                        }
                        html += "<div class='_line'></div>";
                        number += 1;
                    });
                    $('#content').append(html);
                }
            });
        }
    } 
    $(window).scroll(function () {
        loaddata();
    });

})


</script>

<include file="Public:footer" /> 